package com.dhc.redpacket.common;

/**
 * 返回给前台的json数据包装类
 */
public class ResponseBody {
  private Integer code;
  private String msg;
  private Object data;

  // 成功的
  public static ResponseBody successResponse(String msg, Object data) {
    return new ResponseBody(100, msg, data);
  }

  // 失败的
  public static ResponseBody errorResponse(String msg, Object data) {
    return new ResponseBody(-1, msg, data);
  }

  public ResponseBody() {
    super();
  }

  public ResponseBody(Integer code, String msg, Object data) {
    super();
    this.code = code;
    this.msg = msg;
    this.data = data;
  }

  public Integer getCode() {
    return code;
  }

  public void setCode(Integer code) {
    this.code = code;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public Object getData() {
    return data;
  }

  public void setData(Object data) {
    this.data = data;
  }

}
